import { Pipe, PipeTransform } from '@angular/core';
import { TaskType } from 'app/modules/task/services/task.service';

@Pipe({
	name: 'taskType',
})
export class TaskTypePipe implements PipeTransform {
	transform(type: TaskType): string {
		// alert(TaskType.Policy==1005)
		// alert(type)
		// alert(type==1005)


		// 		UsbAuth = 1008,
		//   DetelePc = 1009,
		//   Client = 1010,


// 		usb授权
// 删除终端
// 客户端升级

		switch (type) {
			case TaskType.All:
				return '全部';
			case TaskType.SystemUpgrade:
				return '系统升级';
			case TaskType.SoftwareUpgrade:
				return '软件升级';
			case TaskType.Script:
				return '执行脚本';
			case TaskType.Message:
				return '下发消息';
			case TaskType.Policy:
				return '执行权限';
			case TaskType.UsbAuth:
				return 'usb授权';
			case TaskType.DetelePc:
				return '删除终端';
			case TaskType.Client:
				return '客户端升级';
		}
		return null;
	}
}
